home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / batch / testif / testif.doc next >
Text File  |  1989-12-01  |  9KB  |  256 lines

  1. Computer Tyme TESTIF * Copyright 1989 by Marc Perkel
  2. All Rights Reserved * Version 1.2 * Release Date: 12-01-89
  3.  
  4. This program tests the system and returns dos error codes that can be used
  5. to control the execution of .BAT files. Error codes range from 0 to 255.
  6. Within this program are commands for reading system parameters and processing
  7. them mathematically into useful error codes.
  8.  
  9.   REM This checks to see if selected screen is MONO or COLOR
  10.   TESTIF VideoMode
  11.   IF ERRORLEVEL 7 GOTO MONO
  12.   :COLOR
  13.      ....
  14.      ....
  15.      GOTO END
  16.   :MONO
  17.      ....
  18.      ....
  19.   :END
  20.  
  21. VideoMode is a Testif command that returns the current video mode. If the
  22. current mode is MONO then VideoMode returns a 7.
  23.  
  24. With this command, if you have both MONO and COLOR screens on your computer,
  25. and you want to set up a .BAT file to bring up a piece of software that is
  26. installed different for mono and COLOR, Testif makes it easy.
  27.  
  28. Testif has the capibility to test results to see if a command equals a
  29. value.
  30.  
  31.   TESTIF VideoMode = 7
  32.  
  33. Returns error code 1 if true and 0 if not true. A 1 is always returned to
  34. indicate TRUE and 0 is returned to indicate FALSE. Operators include
  35. =, [], [, ], [=, ]=. Note the square brackets replace the normal greater
  36. than and less than symbols. That is becuase MS-DOS filters these characters
  37. and therefore can't be used.
  38.  
  39.   TESTIF Year = 88 and Month = May
  40.  
  41. Testif supports all logical operators such as AND, OR, XOR, NOT. Multiple
  42. conditions can be used. Year returns the year part of the system date. Month
  43. returns the month part. May is a constant equal to 5. The error code result
  44. will be 1 for true or 0 for false.
  45.  
  46.   TESTIF MemSize / 10
  47.  
  48. MemSize returns the total memory size in K. Since this number is usually
  49. larger than 255, (the maximum error code), we devide by 10. On a 640k
  50. machine, the return code is 64. Notice that division is supported. Testif
  51. supports the mathematical operators +, -, *, /, MOD, SHL, SHR, AND, OR, XOR.
  52. All numbers are processed as signed 32 bit integers. It is up to you to
  53. keep the result between 0 and 255 for meaningful results.
  54.  
  55.   TESTIF 5*(9+3)
  56.  
  57. Interpretation is from left to right. Parentheses can be used to alter this
  58. order. The above example returns 60.
  59.  
  60.   TESTIF FreeSpace(0) ] 4000000
  61.  
  62. This checks freespace on the current drive (0). Other drives can also be
  63. checked. The result is 1 if more than 4,000,000 bytes are free.
  64.  
  65.   TESTIF FileSize TESTIF.EXE / 1000
  66.  
  67. This returns the filesize of TESTIF.EXE in K.
  68.  
  69. To test your formulas, start the line with an @ sign. Testif will print the
  70. return code on the screen.
  71.  
  72.    TESTIF @DosVersion
  73.    Return Code: 3
  74.  
  75.  
  76. TESTIF Commands:
  77.  
  78. SUN  Constant = 0
  79. MON  Constant = 1
  80. TUE  Constant = 2
  81. WED  Constant = 3
  82. THU  Constant = 4
  83. FRI  Constant = 5
  84. SAT  Constant = 6
  85.  
  86. JAN  Constant = 1
  87. FEB  Constant = 2
  88. MAR  Constant = 3
  89. APR  Constant = 4
  90. MAY  Constant = 5
  91. JUN  Constant = 6
  92. JUL  Constant = 7
  93. AUG  Constant = 8
  94. SEP  Constant = 9
  95. OCT  Constant = 10
  96. NOV  Constant = 11
  97. DEC  Constant = 12
  98.  
  99. MONO Constant = 7
  100. CO80 Constant = 3
  101. BW80 Constant = 2
  102. CO40 Constant = 1
  103. BW40 Constant = 0
  104.  
  105. VideoMode             Returns Current Video Mode
  106. VideoPage             Returns Current Video Page
  107. ScreenWidth           Returns Current Screen Width
  108. Year                  Returns System Year            (88=1988)
  109. Month                 Returns System Month
  110. Day                   Returns System Day
  111. DayOfWeek             Returns System Day of week     (0=SUN)
  112. Hour                  Returns System Hour
  113. Minute                Returns System Minute
  114. Second                Returns System Second
  115. WriteVerify           Returns if Write Verify is on
  116. DosVersion            Returns Dos Version Number
  117. MinorDosVersion       Returns Minor Dos Version Number
  118. CurrentDrive          Returns Current Drive Number   (A: = 0)
  119. Drives                Returns Number of Drives
  120. Floppies              Returns Number of Floppy Drives
  121. SerialPorts           Returns Number of Serial Ports
  122. ParellelPorts         Returns Number of Parralel Ports
  123. CapsLock              Tells if Caps Lock is on               (1=True)
  124. NumLock               Tells if Num Lock is on                (0=False)
  125. ScrollLock            Tells if Scroll Lock is on
  126. MemSize               Returns Total Memory Size in K
  127. Random                Returns a Random Number from 0 to 255.
  128. SectorsPerCluster(n)  Returns Number of Sectors per Cluster  (0=Current Drive)
  129. BytesPerSector(n)     Returns Number of Bytes per Sector     (1=A:)
  130. FreeClusters(n)       Returns Number of Free Clusters        (2=B:)
  131. TotalClusters(n)      Returns Total Number of Clusters       (3=C:)
  132. FreeSpace(n)          Returns Free Space in Bytes            (4=D:)
  133. TotalSpace(n)         Returns Total Space in Bytes
  134. Exist <FileName>      Tells if File Exists
  135. FileSize <FileName>   Returns File Sise in Bytes
  136. FileAttr <FileName>   Returns File Attribute
  137. FileDate <FileName>   Returns Date and Time as 32 bit Number
  138. Mem(A:B)              Returns Byte at A:B
  139. MemW(A:B)             Returns Word at A:B
  140. Port(A)               Returns Byte at Part A
  141.  
  142. =     True if A = B
  143. []    True if A <> B
  144. [     True if A < B
  145. ]     True if A > B
  146. [=    True if A <= B
  147. ]=    True if A >= B
  148. +     Returns A + B
  149. -     Returns A - B
  150. *     Returns A * B
  151. /     Returns A / B
  152. MOD   Returns A mod B
  153. AND   Returns A and B
  154. OR    Returns A or B
  155. XOR   Returns A xor B
  156. SHL   Returns A shl B  (Shift Left)
  157. SHR   Returns A shr B  (Shift Right)
  158. NOT   Returns not A
  159.  
  160. ==============================================================
  161.  
  162. The Computer Tyme Dos ToolBox... Makes DOS easier for the novice,
  163. more powerful for the professional.
  164.  
  165. Directory Master is a powerful hard disk managment utility. It brings up
  166. your hard disk files and allows you to mark selected files so you can
  167. copy them, delete them, or move them. It also allows you to rename
  168. files, change dates, and change attributes. You can also run programs or
  169. set up your function keys to run programs on selected files.
  170.  
  171. Dolist makes being at DOS easier. It gives you full line editing, like a
  172. word processor, for your commands. It also stores commands so that you
  173. can re-execute them. It remembers subdirectories and allows you to go
  174. back to them by pressing the TAB key. It offers programmable function
  175. keys, DOS extensions, multiple execution, and many more features you
  176. have got to have.
  177.  
  178. Pick Directory allows you to move through the directory system by
  179. displaying a graphic tree and letting you use your arrow keys to move
  180. around. It also lets you create, delete, rename, and hide directories.
  181.  
  182. TEdit (from SemWare) is a powerful, easy to use full screen editor.
  183.  
  184. And many more ... Also includes is D, a fancy directory listing program;
  185. WHEREIS, for finding stuff on you hard disk, SORT, MOVE, FIND, FREE,
  186. PIPEDIR, VERSION, and many more.
  187.  
  188. The Dos Toolbox sells for $39.95.
  189.  
  190. ================================================================
  191.  
  192. MarxMenu:
  193.  
  194. MarxMenu is the most powerful menu system on the planet. It uses NO
  195. RAM when it runs your applications. It has a menu language with over
  196. 300 commands. This allows you to create menus with multi-layer
  197. exploding windows, conditional menus, full math functions and string
  198. routines, screen blanker, passwords and complete flexibility. This
  199. menu is written for the power user. MarxMenu is NETWORK READY.
  200.  
  201. MarxMenu sells for $39.95.
  202.  
  203. Network versions $495/server.
  204.  
  205. Computer Tyme BBS: (417) 866-1665
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.         Make Check            Computer Tyme          Order Form 2.6
  220.         Payable To:        216 South Glenstone
  221.                           Springfield Mo. 65802
  222.                      (417) 866-1222  (800) 548-5353
  223.  
  224.  
  225.         Please send me the Computer Tyme DOS Toolbox.
  226.  
  227.         =============================================================
  228.  
  229.         Name:        ________________________________________________
  230.  
  231.         Address:     ________________________________________________
  232.  
  233.         City/St/Zip: ________________________________________________
  234.  
  235.         Phone:       ________________________________________________
  236.  
  237.         Computer:    ________________________________________________
  238.  
  239.         Got DM From: ________________________________________________
  240.  
  241.         Comments:    ________________________________________________
  242.  
  243.                      ________________________________________________
  244.  
  245.                      ________________________________________________
  246.  
  247.         ___ Enclosed is $39.95 for The ToolBox.
  248.         ___ Enclosed is an additional $39.95 for MarxMenu.
  249.         ___ Add $3.00 for Shipping and Handling.
  250.  
  251.         ___ I need 3 1/2 Inch Media.
  252.  
  253.         =============================================================
  254.  
  255.  
  256.